package vip.xiaonuo.facedoor.modular.device.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
@Slf4j
public class DeviceHandler {

    @Resource
    private DeviceHandleCenter center;

    @EventListener
    public void getListenerData(DeviceChangeEvent event) {
        DeviceChangeTypeEnum changeType = event.getChangeType();
        DeviceSourceEnum source = event.getDeviceSource();
        center.handle(changeType,source, event.getSource());
    }

}
